#!/usr/bin/env python  
# encoding: utf-8   

""" 
@version: v1.0 
@author: null 
@software: PyCharm 
@file: settings.py
@time: 2017.4.29 9:25 
"""

import random

#请求头agent
user_agent_list = [
    'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1]',
    'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36',
    'Mozilla/5.0 (Linux; Android 5.1.1; Nexus 6 Build/LYZ28E) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.23 Mobile Safari/537.36'
]
#随机选择
agent = random.choice(user_agent_list)

ProxyConnection="keep-alive"
Accept="application/json, text/javascript, */*; q=0.01"
AcceptEncoding="gzip, deflate, sdch"
ContentType="application/x-www-form-urlencoded; charset=UTF-8"
#正常请求头
headers = {
    "User-Agent": agent,
    "Connection":ProxyConnection,
    "Accept":Accept,
    "Accept-Encoding":AcceptEncoding,
    "Content-Type":ContentType,
    "Host":"m.weibo.cn",
    "Origin":"http://m.weibo.cn",
    "Referer":"http://m.weibo.cn"
}
#点赞请求头
likeHeaders ={
    "User-Agent": agent,
    "Proxy-Connection":ProxyConnection,
    "Accept":Accept,
    "Accept-Encoding":AcceptEncoding,
    "Content-Type":ContentType,
    "DNT":"1",
    "Host":"m.weibo.cn",
    "Origin":"http://m.weibo.cn",
    "Referer":"http://m.weibo.cn/?sudaref=security.weibo.com"
}
#
postHeaders={
    "User-Agent": agent,
    "Accept":Accept,
    "Accept-Encoding":AcceptEncoding,
    "Content-Type":ContentType,
    "DNT":"1",
    "Host":"m.weibo.cn",
    "Referer":"http://m.weibo.cn/",
    "X-Requested-With": "XMLHttpRequest",
    "Connection": "keep-alive"
}
#登录请求头
loginHeaders = {
    'User_Agent': agent,
    'Referer': 'https://passport.weibo.cn/signin/login?entry=mweibo&res=wel&wm=3349&r=http%3A%2F%2Fm.weibo.cn%2F',
    'Origin': 'https://passport.weibo.cn',
    'Host': 'passport.weibo.cn',
    'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'
}
#搜索请求头
searchHeaders = {
    "User-Agent":agent,
    "Referer":"",
    "Accept":"application/json, text/plain, */*",
    "Accept-Language":"zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
    "Accept-Encoding":"gzip, deflate",
    "X-Requested-With":"XMLHttpRequest",
    "Connection":ProxyConnection,
    "Host":"m.weibo.cn",
    "Origin":"http://m.weibo.cn"
}
#关注请求头
followHeaders={
    "User-Agent":agent,
    "Accept":Accept,
    "X-Requested-With":"XMLHttpRequest",
    "Content-Type":ContentType,
    "Connection":ProxyConnection,
    "Accept-Encoding":AcceptEncoding,
    "Host":"m.weibo.cn",
    "Origin":"http://m.weibo.cn",
    "Referer":"",
}
#搜索关键字请求头
searchKeyHeaders={
    "User-Agent":agent,
    "Referer":"http://m.weibo.cn/searchs",
    "Accept":"application/json, text/plain, */*",
    "Accept-Language":"zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
    "Accept-Encoding":"gzip, deflate",
    "X-Requested-With":"XMLHttpRequest",
    "Connection":ProxyConnection,
    "Host":"m.weibo.cn",
    "Origin":"http://m.weibo.cn",
    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8"
}

commentHeaders={
    "Host": "m.weibo.cn",
    "User-Agent": agent,
    "Accept": "application/json, text/javascript, */*; q=0.01",
    "Accept-Language": "zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3",
    "Accept-Encoding": "gzip, deflate",
    "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
    "X-Requested-With": "XMLHttpRequest",
    "Referer": "",
    "Connection": "keep-alive"
}


#数据库配置
dbpath="..\weibo\db\weiboInfo.db"

#--配置
username=''
password=''
proxy={}